<% layout('/layouts/default.html', {title: '登录', libs: ['validate'], bodyClass: 'login-page'}){ %>
<% include('/include/upgrade.html'){} // 如果客户浏览器版本过低，则显示浏览器升级提示。 %>
<link rel="stylesheet" href="${ctxStatic}/icheck/1.0/square/blue.css?${_version}">
<link rel="stylesheet" href="${ctxStatic}/jquery-toastr/2.0/toastr.min.css?${_version}">
<link rel="stylesheet" href="${ctxStatic}/modules/sys/sysLogin.css?${_version}">
<div class="login-box">
    <div class="login-logo">
        <a href="${ctx}/login"><b>${@Global.getConfig('productName')}</b>
            <small>${@Global.getConfig('productVersion')}</small></a>
    </div>
    <div class="login-box-body">
        <#form:form id="loginForm" model="${user!}" action="${ctx}/login" method="post">
            <div class="form-group has-feedback">
                <span class="glyphicon glyphicon-user form-control-feedback" title="${text('登录账号')}"></span>
                <#form:input type="text" name="username" class="form-control required"
                        data-msg-required="${text('请填写登录账号.')}" placeholder="userId:${userId}" value="${cookie('rememberUserCode')}"/>
            </div>
            <div class="form-group has-feedback">
				<span class="glyphicon glyphicon-lock form-control-feedback"
                      title="${text('登录密码，鼠标按下显示密码')}"
                      onmousedown="$('#password').attr('type','text')"
                      onmouseup="$('#password').attr('type','password')"></span>
                <#form:input type="password" name="password" class="form-control required"
                        data-msg-required="${text('请填写登录密码.')}" placeholder="openId:${openId}" autocomplete="off"/>
            </div>
            <%/*<!-- if(@Global.getConfigToBoolean('user.useCorpModel', 'false')){ %>
			<div class="form-group has-feedback">
				<select name="param_corpCode" class="form-control">
					<% for(var user in @UserUtils.findCorpList()){ %>
						<option value="${user.corpCode}">(${user.corpCode}) ${user.corpName}</option>
					<% } %>
				</select>
			</div>
			<% } -->*/%>
            <div class="form-group has-feedback" id="isValidCodeLogin">
                <#form:validcode name="validCode" isRequired="true" isRemote="true" isLazy="false"/>
            </div>
            <div class="form-group">
                <div class="mt5 icheck">
                    <label title="${text('公共场所慎用,下次不需要再填写帐号')}"><input type="checkbox"
                                                                       name="rememberUserCode"${isNotBlank(cookie('rememberUserCode'))?' checked':''}
                        class="form-control" data-style="square-blue"> ${text('记住账号')}</label> &nbsp;

                </div>
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-primary btn-block btn-flat"
                        id="btnSubmit" data-loading="${text('登录验证成功，正在进入...')}"
                        data-login-valid="${text('正在验证登录，请稍后...')}">${text('立即登录')}</button>
            </div>
        </#form:form>
        <div class="row">
            <div class="col-xs-12">
                <a href="${ctxPath}/account/forgetPwd" class="pull-left">[ ${text('忘记密码')} ]</a>
                <% if(@Global.getConfigToBoolean('user.registerUser', 'false')){ %>
                <a href="${ctxPath}/account/registerUser" class="pull-left ml10">[ ${text('注册账号')} ]</a>
                <% } %>
                <% if (@com.jeesite.common.i18n.I18nLocaleResolver.enabled()){ %>
                <div class="dropdown pull-right">
                    <a href="javascript:" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">
                        <i class="fa icon-globe"></i> ${@DictUtils.getDictLabel('sys_lang_type', lang(), 'zh_CN')}
                    </a>
                    <ul class="dropdown-menu">
                        <li class="mt5"></li>
                        <% for(var dict in @DictUtils.getDictList('sys_lang_type')){ %>
                        <li><a href="${ctxPath}/lang/${dict.dictValue}">${dict.dictLabel}</a></li>
                        <% } %>
                        <li class="mt10"></li>
                    </ul>
                </div>
                <% } %>
            </div>
        </div>
    </div>
    <div class="login-copyright">
        &copy; ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
            href="http://jeesite.com">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
    </div>
</div>
<% } %>
<script>var secretKey = '${@Global.getConfig("shiro.loginSubmit.secretKey")}';</script>
<script src="${ctxStatic}/jquery-toastr/2.0/toastr.min.js?${_version}"></script>
<script src="${ctxStatic}/common/des.js?${_version}"></script>
<script src="${ctxStatic}/modules/sys/sysLogin.js?${_version}"></script>